package com.lukk.controller;

import javax.annotation.Resource;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lukk.pojo.CityCostRule;
import com.lukk.service.ICityCostRuleService;

/**
 * 
 * CityCostRuleForController 上午10:17:28
 * 
 * Copyright zhaocj Inc. All rights reserved. Love ME Like Justin Bieber.
 */

@Controller
@RequestMapping("/cityCostRule/")
public class CityCostRuleForController {
	private static Logger logger = LogManager.getLogger(CityCostRuleForController.class.getName());
	@Resource
	ICityCostRuleService cityCostRuleService;

	/**
	 * 根据城市的Code查询该城市的扣费规则
	 * 
	 * @param cityCode
	 * @return
	 */
	@RequestMapping("queryCostRuleByCityCode")
	public @ResponseBody CityCostRule queryCostRuleByCityCode(String cityCode) {
		logger.debug("查询参数{}", cityCode);
		return cityCostRuleService.selectCostRuleByCityCode(cityCode);
	}

	/**
	 * 根据工人的ID查询所在城市的扣费规则
	 * 
	 * @param workerID
	 * @return
	 */
	@RequestMapping("queryCostRuleByWorkerID")
	public @ResponseBody CityCostRule queryCostRuleByWorkerID(Integer workerID) {
		logger.debug("查询参数{}", workerID);
		return cityCostRuleService.queryCostRuleByWorkerID(workerID);
	}
}
